<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;

class BaseController extends Controller
{
    protected function success($msg='成功', $result=array(), $url=''){
        return response()->json(array('status'=>1, 'msg'=>$msg, 'result'=>$result, 'url'=>$url));
    }

    protected function error($msg='失败', $result=array(), $url=''){
        return response()->json(array('status'=>0, 'msg'=>$msg, 'result'=>$result, 'url'=>$url));
    }

    protected function returnJson($status=1, $msg='success', $result=array()){
        return response()->json(array('status'=>$status, 'msg'=>$msg, 'result'=>$result));
    }
}
